package com.ruoyi.im.service.impl;

import com.ruoyi.common.support.Convert;
import com.ruoyi.im.domain.FriendApplication;
import com.ruoyi.im.mapper.FriendApplicationMapper;
import com.ruoyi.im.service.IFriendApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 好友申请 服务层实现
 * 
 * @author ruoyi
 * @date 2018-11-06
 */
@Service
public class FriendApplicationServiceImpl implements IFriendApplicationService 
{
	@Autowired
	private FriendApplicationMapper friendApplicationMapper;

	/**
     * 查询好友申请信息
     * 
     * @param id 好友申请ID
     * @return 好友申请信息
     */
    @Override
	public FriendApplication selectFriendApplicationById(Long id)
	{
	    return friendApplicationMapper.selectFriendApplicationById(id);
	}
	
	/**
     * 查询好友申请列表
     * 
     * @param friendApplication 好友申请信息
     * @return 好友申请集合
     */
	@Override
	public List<FriendApplication> selectFriendApplicationList(FriendApplication friendApplication)
	{
	    return friendApplicationMapper.selectFriendApplicationList(friendApplication);
	}
	
    /**
     * 新增好友申请
     * 
     * @param friendApplication 好友申请信息
     * @return 结果
     */
	@Override
	public int insertFriendApplication(FriendApplication friendApplication)
	{
	    return friendApplicationMapper.insertFriendApplication(friendApplication);
	}
	
	/**
     * 修改好友申请
     * 
     * @param friendApplication 好友申请信息
     * @return 结果
     */
	@Override
	public int updateFriendApplication(FriendApplication friendApplication)
	{
	    return friendApplicationMapper.updateFriendApplication(friendApplication);
	}

	/**
     * 删除好友申请对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteFriendApplicationByIds(String ids)
	{
		return friendApplicationMapper.deleteFriendApplicationByIds(Convert.toStrArray(ids));
	}
	
}
